const a = [
  "2022-06-12 14:49:46",
  "2022-06-14 21:38:16",
  "2022-06-12 14:49:46",
].sort((a, b) => a.localeCompare(b));

console.log(a);
// console.log(new Date("2022-06-12 14:49:46"));
